package com.designoutput.ui.options
{
	import com.designoutput.elements.ImageElement;
	import com.designoutput.event.ChangeEvent;
	import com.designoutput.ui.controls.Button;
	import com.designoutput.ui.controls.Checkbox;
	import com.designoutput.ui.controls.Literal;
	import com.designoutput.ui.controls.NumberInput;
	
	import flash.events.MouseEvent;
	import com.designoutput.manager.ResourceManager;

	public class ImageOption extends BaseOption
	{
		public var aspectRatioChx:Checkbox;
		public var aspectRatioBtn:Button;
		
		public function ImageOption(parent:DesignoutputCard)
		{
			super(parent);

			/***************************************/

			
//			aspectRatioChx=new Checkbox(U.RM("rm_image_aspect_ratio"));
//			aspectRatioChx.addEventListener(ChangeEvent.CHANGE, onRestoreProportion);
//			aspectRatioChx.x=10;
//			aspectRatioChx.y=45;
//			addChild(aspectRatioChx);
			
			aspectRatioBtn = new Button(ResourceManager.getValue("rm_image_aspect_ratio"), 90);
			aspectRatioBtn.addEventListener(MouseEvent.MOUSE_DOWN, this.aspectRatio);
			aspectRatioBtn.x = 10;
			aspectRatioBtn.y = 117;
			addChild(aspectRatioBtn);
			
			addChild(depthManager);
			
			resize();
		}

		public function resize():void
		{
			depthManager.y=147;
		}
		
		public function updateOptions(elementType:String,element:ImageElement,bothShirtAndSleeves:Boolean=false,forSleeveElements:Boolean=false):void{
			super.updateBaseInfor(element,bothShirtAndSleeves,forSleeveElements);
		}
		
//		private function onRestoreProportion(evt:ChangeEvent):void{
//			this.p.command.onRestoreProportion();
//		}
		
		private function aspectRatio(evt:MouseEvent):void{
			this.designOutputCard.command.onRestoreProportion();
		}
	}
}